import "@babel/polyfill";
import Vue from "vue";
import Router from "vue-router";
import router from "./route";
import App from "./App";
Vue.use(Router);


var baseSize = 100;
var baseWidth = 750;
var sWidth;
var rootEl;

function screenChange() {
    sWidth = window.screen.width;
    rootEl = document.documentElement;
    if (sWidth && rootEl) {
        if (sWidth > baseWidth) {
            rootEl.style.fontSize = "100px";
        } else {
            rootEl.style.fontSize = `${(sWidth * baseSize) / baseWidth}px`;
        }
    } else if (rootEl) {
        rootEl.style.fontSize = `${baseSize}px`;
    }
}
screenChange();
window.addEventListener("resize", () => {
    screenChange();
});

new Vue({
    el: "#app",
    router,
    render: h => h(App),
});
